<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 选中的是p标签中的第一个 */
    /* p:first-child {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* 选中p标签中的最后一个 */
    /* p:last-child {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* 选中div中每个p标签的第一个 */
    /* p:first-of-type {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* 选中div中每个p标签的最后一个 */
    /* p:last-of-type {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* 取当前父元素的第n个 */
    /* p:nth-child(1) {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* 指定当前元素的第n个 */
    /* p:nth-of-type(2) {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* div[class] {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* div[class="box1"]{
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* div[class^="b"] {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* div[class$="1"] {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
    /* div[class*='o'] {
      width: 80px;
      color: aqua;
      background-color: blueviolet;
      border: 5px solid rgb(60, 255, 0);
    } */
  </style>
</head>

<body>
  <div class="box">
    <div class="box1">
      <p>段落0</p>
      <p>段落1</p>
    </div>
    <p>段落2</p>
    <p>段落3</p>
    <p>段落4</p>
  </div>
</body>

</html>